package com.huawei.java.pojo;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class InputReader {
    BufferedReader reader;
    StringTokenizer tokenizer;
    public InputReader () {
        tokenizer = null;
        reader = new BufferedReader(new InputStreamReader(System.in), 32768);
    }

    public String next () {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt () {
        return Integer.parseInt(next());
    }

    public String nextLine () {
        try {
            return reader.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}
